package com.zh.constant;

public interface TaskConstant {

    /**
     * 任务状态：规划中
     */
    int TASK_STATUS_PLANNING = 0;

    /**
     * 任务状态：进行中
     */
    int TASK_STATUS_IN_PROGRESS = 1;

    /**
     * 任务状态：暂停中
     */
    int TASK_STATUS_PAUSED = 2;

    /**
     * 任务状态：已逾期
     */
    int TASK_STATUS_OVERDUE = 3;

    /**
     * 项目状态：已完成
     */
    int TASK_STATUS_COMPLETED = 4;
    /**
     * 项目状态：废弃
     */
    int TASK_STATUS_DISCARDED = 5;

    static boolean isValidStatus(Integer status) {
        return (null != status) && (status >= TASK_STATUS_PLANNING && status <= TASK_STATUS_COMPLETED);
    }

    //根据状态获取状态名称
    static String getStatusName(Integer status) {
        switch (status) {
            case TASK_STATUS_PLANNING:
                return "未开始";
            case TASK_STATUS_IN_PROGRESS:
                return "进行中";
            case TASK_STATUS_PAUSED:
                return "暂停中";
            case TASK_STATUS_OVERDUE:
                return "已逾期";
            case TASK_STATUS_COMPLETED:
                return "已完成";
            case TASK_STATUS_DISCARDED:
                return "废弃";
            default:
                return null;
        }
    }

    static String getBugStatusName(Integer status) {
        switch (status) {
            case TASK_STATUS_PLANNING:
                return "待解决";
            case TASK_STATUS_IN_PROGRESS:
                return "已解决";
            case TASK_STATUS_COMPLETED:
                return "已修复";
            case TASK_STATUS_DISCARDED:
                return "已关闭";
            default:
                return null;
        }
    }
}
